#=============================================================================
# StripExperiment PROJECT's MAKEFILE of object
# 
# Main role is to create exec file
#
# author suzuki ryoutoku
#=============================================================================

#=============================================================================
# To set value
#=============================================================================
dependfile = $(addprefix depend/, $(shell ls $(depends_directory)))
objectfile = $(addsuffix .o, $(basename $(notdir $(dependfile))) )

each_sources = $(shell find $(source_directory) -type d)
GNOME_LINK_CONFIG := $(shell pkg-config gtk+-2.0 --libs gthread-2.0)

vpath %.cpp $(each_sources)
vpath %.h $(each_sources)

CFLAGS= -I$(source_directory)/  -I$(library_directory)/ -g -I/usr/include/:/usr/include/X11/ -I/usr/include/GL -L/usr/lib/X11 -DDEBUG=1 
CXXFLAGS=$(CFLAGS)

#=============================================================================
# target & rule
#=============================================================================
all : TEST $(FILE_NAME)

TEST :;
	@echo $(dependfile)

$(FILE_NAME) : $(objectfile)
	$(CC) -lX11 -lGL $(GNOME_LINK_CONFIG) -o $@ $(objectfile)

include $(dependfile)

%.o : %.cpp
	$(CC) $(CXXFLAGS) $(GNOME_COMPILE_CONFIG) -c -I$(dir $<) $<

